from django.shortcuts import render, redirect, reverse
from django.contrib.auth.decorators import login_required
from django.contrib.auth import authenticate, login
from django.shortcuts import HttpResponse,render_to_response
from weboperation import *
# Create your views here.
def do_login(request):
    data = {'LoginStatus':''}
    if request.method == 'POST':
        postDate = request.POST
        username = postDate.get('username')
        password = postDate.get('password')
        if username == 'dongyaoyao' and password == '123':
            return render('home/home.html')
        else:
            data['LoginStatus'] = '用户名或密码错误'
    return render_to_response("login.html",data)

def home(request):
    return render(request,'home/home.html',{'username':request.POST.get('username')})